import math
'''
d=2,fmin=-1.8013
d=5,fmin=-4.687658
d=10 fmin=-9.66015
'''
def Michalewicz(dim, arr, m):
    fx = 0
    for i in range(dim):
        fx = fx + math.sin(arr[i]) * (math.sin(((i+1) * arr[i] ** 2)/ math.pi) ) ** (2 * m)
    return -fx






